package cn.hongwei.service.impl;

import cn.hongwei.dao.UsersMapper;
import cn.hongwei.pojo.Users;
import cn.hongwei.service.UsersService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Great
 * @email 1224028994@qq.com
 */
@Service
@Transactional
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements UsersService {

    @Override
    public List<String> queryAllUsersNo() {
        QueryWrapper<Users> wrapper=new QueryWrapper();
        wrapper.select("users_no");
        wrapper.eq("status",1);
        List<Users> users = baseMapper.selectList(wrapper);
        List<String> usersNos=new ArrayList<>();
        for (Users user : users) {
            usersNos.add(user.getUsersNo());
        }
        return usersNos;
    }
}
